Jes.Comm ={
	initUser : function(){
		if(!Jes.userSess()) return;
		//Jes.cBtn();
		Jes('search').onclick=function(){Jes.Comm.queryUser();}
		Jes('add').onclick=function(){Jes.Comm.sel();}
		Jes('clear').onclick=function(){Jes.Comm.clear();}
		Jes('close').onclick=function(){parent.Jes.FlyDiv.hide();}
		this.queryUser();
	}
	,queryUser : function(){
		Jes.page('usersel_query_sql@acl',{pageSize:10});
	}
	,sel : function(){
		var param = Jes.vals('form1','',-1),ids = param.id.split('_'),nas=param.realname.split('_'),_id='',_na='';
		var __ids = parent.Jes.val('userids')||'',__nas=parent.Jes.html('usernames')||'';
		Jes.each(ids,function(i){
			if(ids[i]!='null'){
				if(__ids.indexOf(ids[i])==-1){
					_id+=(_na==''?'':',')+"'"+ids[i]+"'";
					_na+=(_na==''?'':',')+nas[i];
				}
			}
		});
		var _f =__ids==''?'':(_id==''?'':',');
		parent.Jes.vals({'userids':__ids+_f +_id,'usernames':__nas+_f+_na});
		//var unames = p
	}
	,clear : function(){
		parent.Jes.vals({'userids':'','usernames':''});
	}
}